<template>
	<view style="border-top: 2upx solid #f4f4f4;background-color: #f7f7f7;" class="content">		
		<view @click.stop="videoFlag=false" v-if="videoFlag" style="margin-top: -100px;width: 100%;height:100vh;background-color: rgb(0,0,0,0.9);position: fixed;z-index: 99999999;"> 
			 <video  @click.stop style="width: 100%;margin-top: 50vh;transform: translateY(-50%);" :autoplay="autoplay" :src="currentVideo" :action="audioAction" controls></video>
		</view>
		<view v-if="plLis">
			<view v-for="(item,index) in plLis" :key="index" class="commonBox ">
				<view class="flexsb">
					<view style="width: 160upx;" class="">
						<image style="width: 145upx;height: 150upx;" :src="item.geval_goodsimage" mode=""></image>
					</view>
					<view style="width: 500upx;" class="">
						<view class="oneline C333 fs22 lh45">
							{{item.geval_goodsname}}
						</view>
						<view style="min-height: 68upx;" class="twoline fs18 C666 lh35">
							我的评价：{{item.geval_content}}
						</view>
						<view class="fs18 C999 flexBox">
							<view class="">	{{item.geval_addtime | formaDate}} </view>
							<view class="flexBox">
								<view class="" v-for="(item,index3) in Number(item.geval_scores) " :key="index3">
									<image style="width: 26rpx;height: 26rpx;" src="/static/images/star.png" mode=""></image>
								</view>
								<view class="" v-for="(item,index3) in 5-Number(item.geval_scores)" :key="index3">
									<image style="width: 26rpx;height: 26rpx;" src="/static/images/star-grey.png" mode=""></image>
								</view>
							</view>
							
						</view>
					</view>
				</view>
				<view style="display: flex;flex-wrap: wrap;" class="imgAndvid">
					<view v-if="item.geval_video" @click="playThis(current.src)" ref="video1" style="width: 223upx;height: 223upx;margin-top: 10upx;border: 1upx solid #f4f4f4;" class="flexsb">					
					
						<image style="" src="/static/images/videoimg.jpg" mode="center"></image>
						
					</view>
				
					<view v-for="(item2,index2) in item.geval_image" :key="index2">
						<image @click="toLookD(item2,index2)" style="" :src="item2" mode="center"></image>					
					</view>
				
				</view>
				
			</view>
		</view>
		
		<view class="None" v-if="plLis.length<=0">
			<image :src="`${picUrl}/InfoNull.png`" style="width: 100%;" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	import uniRate from '@/components/uni-rate/uni-rate.vue'
	export default {
		components: {uniRate},
		data(){
			return{
				autoplay:true,
				currentVideo:"",
				videoFlag:false,
				 current: {
					src: 'http://daifc.top/meishi/video/yugao.mp4',
				},
				audioAction: {
					method: 'pause'
				},
				searchValue:"",
				plLis:[],
				curpage:1,
				hasmore:0
			}
		},
		onLoad() {
			this.getpinlunLis()
		},
		onShow() {
			
		},
		onReachBottom() {
			if(this.hasmore){
				this.curpage++;
				this.getpinlunLis()
			}else{
				uni.showToast({
					title:'已是最后一页！',
					icon:'none'
				})
			}
		},
		methods:{
			playThis(src){
				this.videoFlag=true
				this.currentVideo=src
			},
			toLookD(imgUrl,index){
				var imgArr=[]
				imgArr.push(imgUrl)
				uni.previewImage({
					urls:imgArr,
					current:imgArr[index]
				})
			},
			getpinlunLis(){
				let that = this;			
				this.$util.request({
					url: '/mobile/index.php?act=member_evaluate&op=list',
					method: 'get',
					data: {
						"curpage":this.curpage
					},
				}).then((res)=> {
					// if(res.datas.list.length == 0){
					// 	uni.showToast({
					// 		title:"您没有评论数据哟～",
					// 		icon:'none'
					// 	})
					// 	return 
					// }
					this.plLis=this.plLis.concat(res.datas.list)
					this.hasmore=res.datas.hasmore

				})
				
			}
	// 		addPl(){				
	// 			var that=this;
	// 			var mytime=new Date();
	// 			var year=mytime.getFullYear();
	// 			var month=mytime.getMonth()+1;
	// 			var day=mytime.getDate();
	// 			if(month<10){
	// 				month="0"+month
	// 			}
	// 			if(day<10){
	// 				day="0"+day
	// 			}
	// 			if(that.searchValue.trim().length>0){
	// 				var aa={}
	// 				aa.userImg="../../static/images/new_plUserLogo.jpg";
	// 				aa.userName="Toms";
	// 				aa.answerTime=year+"年"+month+"月"+day+"日";
	// 				aa.answerInfo=that.searchValue;
	// 				aa.answerImg="";
	// 				aa.answerWhos="";
	// 				that.plLis.push(aa)
	// 				console.log(aa)
	
	// 			}
	// 		}
			
			
		}
	}
</script>

<style>
	.content{
		height: 100%;
	}
	view{
		box-sizing: border-box;
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	.lh20{
		line-height: 20upx;
		height: 20upx;
	}
	.lh25{
		line-height: 25upx;
	}
	.lh30{
		line-height: 30upx;
	}
	.lh35{
		line-height: 35upx;
	}
	.lh40{
		line-height: 40upx;
	}
	.lh45{
		line-height: 45upx;
	}
	.lh50{
		line-height: 50upx;
	}
	.lh80{
		line-height: 80upx;
	}
	.C000{
		color: #000000;
	}
	.Ce13d97{
		color: #ff4300;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.Cc06{
		color: #ff4300;
	}
	.mt55mb30{
		margin-top: 55upx;
		margin-bottom: 30upx;
	}
	.Cfff{
		color: #FFFFFF;
	}
	
	.flex{		
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-content: space-between;
	}
	.paddingL20{
		padding-left: 20upx;
	}
	.C999{
		color:#999 ;
	}
	.Cff0101{
		color:#ff0101 ;
	}
	.Cc00251{
		color: #c00251;
	}
	.strick{
		text-decoration: line-through;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.line1{
		width: 430upx;
	}
	.hide{
		display: none;
	}
	.marginB20{
		margin-bottom: 20upx;
	}
	
	.twoline{
	   overflow : hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.pl20{
		padding-left: 20upx;
	}
	.positionT{
		position: relative;
		top: 50upx;
	}
	.paddingB15{
		padding-bottom: 15upx;
	}
	.borderB{
		border-bottom: 1px solid #f4f4f6;
	}
	.borderT{
		border-top: 1px solid #f4f4f6;
	}
	.gl{
		position: absolute;
		right: 30upx;
	}
	.pr30{
		padding-right: 30upx;
	}
	.C333{
		color: #333333;
	}
	.C666{
		color: #666666;
	}
	.Cf00{
		color: #ff0000;
	}
	
	.bold{
		font-weight: bold;
	}
	.C1d1d1d{
		color:#1d1d1d ;
	}
	.fl{
		float: left;
	}
	.fr{
		float: right;
	}
	.tac{
		text-align: center;
	}
	.Ce5258e{
		color: #e5258e;
	}
	.Cccc{
		color: #CCCCCC;
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}		
	.fs30{
		/* font-size: 30upx */
		font-size: 45upx
	}
	.fs26{
		font-size:39upx
		/* font-size: 26upx */
	}
	.fs12{
		font-size: 18upx
		/* font-size: 12upx */
	}
	.fs16{
		font-size: 24upx
		/* font-size: 16upx */
	}
	.fs14{
		font-size: 21upx
		/* font-size: 14upx */
	}
	.fs15{
		font-size: 22.5upx
		/* font-size: 15upx */
	}
	.fs27{
		font-size: 40.5upx
		/* font-size: 27upx */
	}
	.fs18{
		font-size: 27upx
		/* font-size: 18upx */
	}
	.fs28{
		font-size: 42upx
		/* font-size: 28upx */
	}
	.fs10{
		font-size: 15upx
		/* font-size: 10upx */
	}
	.fs30{
		font-size: 45upx
		/* font-size: 28upx */
	}
	.fs24{
		font-size: 36upx
		/* font-size: 24upx */
	}
	.fs20{
		font-size:30upx
		/* font-size: 20upx */
	}
	.fs22{
		font-size:33upx
		/* font-size: 22upx */
	}
	.fs21{
		font-size: 31.5upx
		/* font-size: 21upx */
	}	
	.flexsb{
		display: flex;
		justify-content: space-between;
	}
	.plr20{
		padding: 0 20upx;
	}
	.plr10{
		padding: 0 10upx;
	}
	.oneline{
	   overflow : hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.commonBox{
		padding:27upx 35upx ;
		background-color: #FFFFFF;
		margin-bottom: 30upx;
	}
	.imgAndvid>view:nth-child(3n+2){
		margin-left:20upx ;
	}
	.imgAndvid>view:nth-child(3n){
		margin-left:20upx ;
	}
	.imgAndvid{
		
	}
	.imgAndvid>view{
		box-sizing: border-box;
		width: 215upx;
		height: 215upx;
		margin-top: 20upx;
		border: 1upx solid #f4f4f4;
	}
	.imgAndvid>view image{
		width: 211upx;
		height: 211upx
	}
	.flexBox{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.None{
		height: 100%;
		background-color: #fff;
	}
</style>
